package com.uidp.hibernatelayer;

// Generated 2013-9-3 16:39:27 by Hibernate Tools 3.4.0.CR1

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.HibernateVO;

/**
 * Groups generated by hbm2java
 */
@Entity
@Table(name = "groups", catalog = "uidpdb")
public class GroupsVO extends HibernateVO {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 7672211248961413L;
	private Integer id;
	private String uniqname;
	private ModulElementsVO modulElements;
	private List<GroupsAttributeVO> groupsAttributes;

	// Constructors

	/** default constructor */
	public GroupsVO() {
		this.groupsAttributes = new ArrayList<GroupsAttributeVO>();
	}

	/** minimal constructor */
	public GroupsVO(ModulElementsVO modulElements) {
		this.modulElements = modulElements;
	}

	/** full constructor */
	public GroupsVO(ModulElementsVO modulElements, String uniqname,
			List<GroupsAttributeVO> groupsAttributes) {
		this.modulElements = modulElements;
		this.groupsAttributes = groupsAttributes;
		this.uniqname = uniqname;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "modul_elements_id", nullable = false)
	public ModulElementsVO getModulElements() {
		return this.modulElements;
	}

	public void setModulElements(ModulElementsVO modulElements) {
		this.modulElements = modulElements;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "groups")
	public List<GroupsAttributeVO> getGroupsAttributes() {
		return this.groupsAttributes;
	}

	public void setGroupsAttributes(List<GroupsAttributeVO> groupsAttributes) {
		this.groupsAttributes = groupsAttributes;
	}

	@Override
	public void setId(Object id) {
		// TODO Auto-generated method stub

	}
	@Column(name = "uniqname", length = 30)
	public String getUniqname() {
		return this.uniqname;
	}
	public void setUniqname(String uniqname) {
		this.uniqname = uniqname;
	}

}
